<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.io.Path</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.io.Path");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791">tango.io.Path</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Mar 2008: Initial version<br><br>
<b>author:</b><br>Kris<br><br>        A more direct route to the file-system than FilePath, but with 
        the potential overhead of heap activity. Use this if you don't
        need path editing or extraction features. For example, if all
        you want is to see if some path exists, using this module might 
        be a more convenient option than FilePath:
        <pre class="d_code">

        <span class="k">if</span> (<span class="i">exists</span> (<span class="sl">"some/file/path"</span>)) 
            ...
        
</pre><br><br>        These functions can be less efficient than FilePath because they 
        may have to attach a null to the filename for each underlying O/S
        call. Use Path when you need pedestrian access to the file-system, 
        and are not manipulating the path components. Use FilePath for other
        scenarios.<br><br>        We encourage the use of "scoped import" with this module, such as
        <pre class="d_code">

        <span class="k">import</span> <span class="i">Path</span> = <span class="i">tango</span>.<span class="i">io</span>.<span class="i">Path</span>;

        <span class="k">if</span> (<span class="i">Path</span>.<span class="i">exists</span> (<span class="sl">"some/file/path"</span>)) 
            ...
        
</pre><br><br>        Also residing here is a lightweight path-parser, which splits a filepath
        into constituent components. See PathParser below:
        <pre class="d_code">

        <span class="k">auto</span> <span class="i">p</span> = <span class="i">Path</span>.<span class="i">parse</span> (<span class="sl">"some/file/path"</span>);
        <span class="k">auto</span> <span class="i">path</span> = <span class="i">p</span>.<span class="i">path</span>;
        <span class="k">auto</span> <span class="i">name</span> = <span class="i">p</span>.<span class="i">name</span>;
        <span class="k">auto</span> <span class="i">suffix</span> = <span class="i">p</span>.<span class="i">suffix</span>;
        ...
        ...
        
</pre><br><br>        Compile with -version=Win32SansUnicode to enable Win95 &amp; Win32s file
        support.<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>struct <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L99">FS</a></span>
<script>explorer.outline.addDecl('FS');</script>; [package]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Wraps the O/S specific calls with a D API. Note that these accept
        null-terminated strings only, which is why it's not public. We need 
        this declared first to avoid forward-reference issues</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>struct <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L107">Stamps</a></span>
<script>explorer.outline.addDecl('Stamps');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">TimeStamp information. Accurate to whatever the F/S supports</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L109">created</a></span>
<script>explorer.outline.addDecl('created');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L109">accessed</a></span>
<script>explorer.outline.addDecl('accessed');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L109">modified</a></span>
<script>explorer.outline.addDecl('modified');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">last time modified</font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>struct <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L120">FileInfo</a></span>
<script>explorer.outline.addDecl('FileInfo');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Passed around during file-scanning</font><br><br>
</dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>struct <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L134">Listing</a></span>
<script>explorer.outline.addDecl('Listing');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Some fruct glue for directory listings</font><br><br>
</dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L160">exception</a></span>
<script>explorer.outline.addDecl('exception');</script>(char[] <span class="funcparam">filename</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Throw an exception using the last known error</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L172">padded</a></span>
<script>explorer.outline.addDecl('padded');</script>(char[] <span class="funcparam">path</span>, char <span class="funcparam">c</span> = '/'); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return an adjusted path such that non-empty instances always
                have a trailing separator</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L186">stripped</a></span>
<script>explorer.outline.addDecl('stripped');</script>(char[] <span class="funcparam">path</span>, char <span class="funcparam">c</span> = '/'); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return an adjusted path such that non-empty instances do not
                have a trailing separator</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L200">join</a></span>
<script>explorer.outline.addDecl('join');</script>(char[][] <span class="funcparam">paths</span>...); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Join a set of path specs together. A path separator is
                potentially inserted between each of the segments.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L217">strz</a></span>
<script>explorer.outline.addDecl('strz');</script>(char[] <span class="funcparam">src</span>, char[] <span class="funcparam">dst</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Append a terminating null onto a string, cheaply where 
                feasible</font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>struct <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L916">PathParser</a></span>
<script>explorer.outline.addDecl('PathParser');</script>;</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Parse a file path</font><br><br>
<font color="black">File paths containing non-ansi characters should be UTF-8 encoded.
        Supporting Unicode in this manner was deemed to be more suitable
        than providing a wchar version of PathParser, and is both consistent
        &amp; compatible with the approach taken with the Uri class.<br><br>        Note that patterns of adjacent '.' separators are treated specially
        in that they will be assigned to the name instead of the suffix. In
        addition, a '.' at the start of a name signifies it does not belong
        to the suffix i.e. ".file" is a name rather than a suffix.<br><br>        Note also that normalization of path-separators occurs by default. 
        This means that the use of '\' characters will be converted into
        '/' instead while parsing. <br><br></font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>PathParser <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L930">parse</a></span>
<script>explorer.outline.addDecl('parse');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Parse the path spec</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>PathParser <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L941">dup</a></span>
<script>explorer.outline.addDecl('dup');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Duplicate this path</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L954">toString</a></span>
<script>explorer.outline.addDecl('toString');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the complete text of this filepath</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L966">root</a></span>
<script>explorer.outline.addDecl('root');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the root of this path. Roots are constructs such as
                "c:"</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L981">folder</a></span>
<script>explorer.outline.addDecl('folder');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the file path. Paths may start and end with a "/".
                The root path is "/" and an unspecified path is returned as
                an empty string. Directory paths may be split such that the
                directory name is placed into the 'name' member; directory
                paths are treated no differently than file paths</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1002">parent</a></span>
<script>explorer.outline.addDecl('parent');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns a path representing the parent of this one. This
                will typically return the current path component, though
                with a special case where the name component is empty. In 
                such cases, the path is scanned for a prior segment:
                <pre class="d_code">

                <span class="i">normal</span>:  /<span class="i">x</span>/<span class="i">y</span>/<span class="i">z</span> =&gt; /<span class="i">x</span>/<span class="i">y</span>
                <span class="i">special</span>: /<span class="i">x</span>/<span class="i">y</span>/  =&gt; /<span class="i">x</span>
                
</pre></font><br><br>
<font color="black">Note that this returns a path suitable for splitting into
                path and name components &#40;there's no trailing separator&#41;.<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1021">name</a></span>
<script>explorer.outline.addDecl('name');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the name of this file, or directory.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1035">ext</a></span>
<script>explorer.outline.addDecl('ext');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Ext is the tail of the filename, rightward of the rightmost
                '.' separator e.g. path "foo.bar" has ext "bar". Note that
                patterns of adjacent separators are treated specially; for
                example, ".." will wind up with no ext at all</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1050">suffix</a></span>
<script>explorer.outline.addDecl('suffix');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Suffix is like ext, but includes the separator e.g. path
                "foo.bar" has suffix ".bar"</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1061">path</a></span>
<script>explorer.outline.addDecl('path');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">return the root + folder combination</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1072">file</a></span>
<script>explorer.outline.addDecl('file');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">return the name + suffix combination</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1084">isAbsolute</a></span>
<script>explorer.outline.addDecl('isAbsolute');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns true if this path is *not* relative to the
                current working directory</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1096">isEmpty</a></span>
<script>explorer.outline.addDecl('isEmpty');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns true if this FilePath is empty</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1110">isChild</a></span>
<script>explorer.outline.addDecl('isChild');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns true if this path has a parent. Note that a
                parent is defined by the presence of a path-separator in
                the path. This means 'foo' within "/foo" is considered a
                child of the root</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>int <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1121">opEquals</a></span>
<script>explorer.outline.addDecl('opEquals');</script>(char[] <span class="funcparam">s</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Does this path equate to the given text?</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>PathParser <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1132">parse</a></span>
<script>explorer.outline.addDecl('parse');</script>(char[] <span class="funcparam">path</span>, uint <span class="funcparam">end</span>); [package]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Parse the path spec with explicit end point</font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1184">exists</a></span>
<script>explorer.outline.addDecl('exists');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Does this path currently exist?</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1199">modified</a></span>
<script>explorer.outline.addDecl('modified');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the time of the last modification. Accurate
        to whatever the F/S supports, and in a format dictated
        by the file-system. For example NTFS keeps UTC time, 
        while FAT timestamps are based on the local time. </font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1213">accessed</a></span>
<script>explorer.outline.addDecl('accessed');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the time of the last access. Accurate to
        whatever the F/S supports, and in a format dictated
        by the file-system. For example NTFS keeps UTC time, 
        while FAT timestamps are based on the local time.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>Time <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1227">created</a></span>
<script>explorer.outline.addDecl('created');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns the time of file creation. Accurate to
        whatever the F/S supports, and in a format dictated
        by the file-system. For example NTFS keeps UTC time,  
        while FAT timestamps are based on the local time.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>ulong <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1238">fileSize</a></span>
<script>explorer.outline.addDecl('fileSize');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return the file length &#40;in bytes&#41;</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1250">isWritable</a></span>
<script>explorer.outline.addDecl('isWritable');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Is this file writable?</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>bool <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1262">isFolder</a></span>
<script>explorer.outline.addDecl('isFolder');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Is this file actually a folder/directory?</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>FS.Stamps <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1278">timeStamps</a></span>
<script>explorer.outline.addDecl('timeStamps');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Return timestamp information</font><br><br>
<font color="black">Timstamps are returns in a format dictated by the 
        file-system. For example NTFS keeps UTC time, 
        while FAT timestamps are based on the local time<br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1290">remove</a></span>
<script>explorer.outline.addDecl('remove');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Remove the file/directory from the file-system</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1302">createFile</a></span>
<script>explorer.outline.addDecl('createFile');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Create a new file</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1314">createFolder</a></span>
<script>explorer.outline.addDecl('createFolder');</script>(char[] <span class="funcparam">name</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Create a new directory</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1337">createPath</a></span>
<script>explorer.outline.addDecl('createPath');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Create an entire path consisting of this folder along with
        all parent folders. The path must not contain '.' or '..'
        segments. Related methods include PathUtil.normalize&#40;&#41; and
        FileSystem.toAbsolute&#40;&#41;</font><br><br>
<font color="black">Note that each segment is created as a folder, including the
        trailing segment.<br><br>        </font><br><br>
<b>Throws:</b><br>
IOException upon system errors<br><br>
<b>Throws:</b><br>
IllegalArgumentException if a segment exists but as a 
        file instead of a folder<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1361">rename</a></span>
<script>explorer.outline.addDecl('rename');</script>(char[] <span class="funcparam">src</span>, char[] <span class="funcparam">dst</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">change the name or location of a file/directory</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1375">copy</a></span>
<script>explorer.outline.addDecl('copy');</script>(char[] <span class="funcparam">src</span>, char[] <span class="funcparam">dst</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Transfer the content of one file to another. Throws 
        an IOException upon failure.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>FS.Listing <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1403">children</a></span>
<script>explorer.outline.addDecl('children');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Provides foreach support via a fruct, as in
        <pre class="d_code">

        <span class="k">foreach</span> (<span class="i">info</span>; <span class="i">children</span>(<span class="sl">"myfolder"</span>))
                 ...
        
</pre></font><br><br>
<font color="black">Each path and filename is passed to the foreach
        delegate, along with the path prefix and whether
        the entry is a folder or not. The info construct
        exposes the following attributes:
        <pre class="d_code">

        <span class="k">char</span>[]  <span class="i">path</span>
        <span class="k">char</span>[]  <span class="i">name</span>
        <span class="k">ulong</span>   <span class="i">bytes</span>
        <span class="k">bool</span>    <span class="i">folder</span>
        
</pre><br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1415">join</a></span>
<script>explorer.outline.addDecl('join');</script>(char[][] <span class="funcparam">paths</span>...);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Join a set of path specs together. A path separator is
        potentially inserted between each of the segments.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1433">standard</a></span>
<script>explorer.outline.addDecl('standard');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Convert path separators to a standard format, using '/' as
        the path separator. This is compatible with Uri and all of 
        the contemporary O/S which Tango supports. Known exceptions
        include the Windows command-line processor, which considers
        '/' characters to be switches instead. Use the native&#40;&#41;
        method to support that.</font><br><br>
<b>Note:</b><br>mutates the provided path.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1448">native</a></span>
<script>explorer.outline.addDecl('native');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Convert to native O/S path separators where that is required,
        such as when dealing with the Windows command-line. 
        
        </font><br><br>
<b>Note:</b><br>mutates the provided path. Use this pattern to obtain a 
        copy instead: native&#40;path.dup&#41;;<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1467">pop</a></span>
<script>explorer.outline.addDecl('pop');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Returns a path representing the parent of this one, with a special 
        case concerning a trailing '/':
        <pre class="d_code">

        <span class="i">normal</span>:  /<span class="i">x</span>/<span class="i">y</span>/<span class="i">z</span> =&gt; /<span class="i">x</span>/<span class="i">y</span>
        <span class="i">special</span>: /<span class="i">x</span>/<span class="i">y</span>/  =&gt; /<span class="i">x</span>
        <span class="k">final</span>:   /<span class="i">x</span>     =&gt; <span class="i">empty</span>
        
</pre></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1485">split</a></span>
<script>explorer.outline.addDecl('split');</script>(char[] <span class="funcparam">path</span>, out char[] <span class="funcparam">head</span>, out char[] <span class="funcparam">tail</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Break a path into "head" and "tail" components. For example: 
        <pre class="d_code">

        <span class="sl">"/a/b/c"</span> -&gt; <span class="sl">"/a"</span>,<span class="sl">"b/c"</span> 
        <span class="sl">"a/b/c"</span> -&gt; <span class="sl">"a"</span>,<span class="sl">"b/c"</span> 
        
</pre></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>char[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1506">replace</a></span>
<script>explorer.outline.addDecl('replace');</script>(char[] <span class="funcparam">path</span>, char <span class="funcparam">from</span>, char <span class="funcparam">to</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Replace all path 'from' instances with 'to', in place &#40;overwrites
        the provided path&#41;</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>PathParser <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/Path.d?rev=3791#L1522">parse</a></span>
<script>explorer.outline.addDecl('parse');</script>(char[] <span class="funcparam">path</span>);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Parse a path into its constituent components. 
        
        Note that the provided path is not duplicated</font><br><br></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2008 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sat Aug  2 16:08:34 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>